import React, {useRef, useState} from "react";
import {SysCompanyInfoData} from "@/pages/company/type";
import {CompanyInfoProps} from "@/pages/company/Stateless";
import {ProFormInstance} from "@ant-design/pro-form";
import {Button} from "antd";
import {field} from "@/pages/company/Stateless/config/filed";


export default (Stateless: any) => {
  const [companyInfo, setCompany] = useState<SysCompanyInfoData>({});
  const formRef: React.MutableRefObject<ProFormInstance<SysCompanyInfoData> | undefined> = useRef<ProFormInstance<SysCompanyInfoData>>();

  const statelessProps: CompanyInfoProps = {
    companyInfo,
    formProps: {
      formRef,
      groupList: field,
      layout: "horizontal",
      submitter: {
        resetButtonProps: {
          style: {
            display: "none"
          }
        },
        submitButtonProps: {
          style: {
            display: "none"
          }
        },
        render: () => [
          <Button >保存</Button>,
          <Button >保存</Button>,

        ]
      }
    }

  }
  return <Stateless {...statelessProps} />
}
